from django.contrib import admin
import datetime
from user.models import User
from  .models import  Category
from  .models import  Course
import os
# Register your models here.
@admin.register(Category)
class CategoryAdmin(admin.ModelAdmin):
    # 定义展示的字段
    list_display = ['cat_name']
    # 定义支持模糊查询的字段
    search_fields = ['cat_name']

@admin.register(Course)
class CourseAdmin(admin.ModelAdmin):
    # 定义多表显示
    filter_horizontal = ['buyer','carshop']
    list_display = ['course_name','id','sender','price']

